require('./Getuserslist.styl');
const classnames = require('classnames')

const reactMixin = require('react-mixin');
const { List, Button } = SaltUI;
import { Control } from 'react-keeper'

class Getuserslist extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            active: props.active,
            CHINA_PROVINCE_JSON: [
                { "text": "甲方" },
                { "text": "乙方" },
                { "text": "专家" },
                { "text": "三方测试" },
                { "text": "监理" }]
        };
        this.handleUserCancle = this.handleUserCancle.bind(this)
    }
    handleClick(event, dataItem) {
        this.props.handleGetUsersList(dataItem)
    }
    handleUserCancle() {
        this.props.handleUserCancle();
    }

    render() {
        const { state: { active }, handleUserCancle } = this
        return (
            <div className={classnames("getuserslist", { 'active': active })} >
                <List
                    layout="right"
                    hasRightIcon={true}
                    isDelete={false}
                    demoTitle=""
                    data={this.state.CHINA_PROVINCE_JSON}
                    onClick={this.handleClick.bind(this)}
                />
                <Button onClick={handleUserCancle}>取消</Button>
            </div>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
        if (this.state.active !== nextProps.active) this.setState({ active: nextProps.active })
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}


module.exports = Getuserslist;
